<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>标题管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }

        function preview(sourceType, sourceId) {
            top.$.jBox.open("iframe:${ctx}/templet/eleTemplet/preview?sourceType="+sourceType+"&sourceId=" + sourceId, "<spring:message code='preview'/>", 500, 420, {showScrolling: false});
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/source/title/eleSourceTitle/"><spring:message code="title.list"/></a></li>
		<shiro:hasPermission name="source:title:eleSourceTitle:edit"><li><a href="${ctx}/source/title/eleSourceTitle/form"><spring:message code="title.add"/></a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="eleSourceTitle" action="${ctx}/source/title/eleSourceTitle/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label><spring:message code="title.name"/>：</label>
				<form:input path="content" htmlEscape="false" maxlength="255" class="input-medium"/>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="<spring:message code='common.Query'/>"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed" >
		<thead>
			<tr>
				<th><spring:message code="common.title"/></th>
				<th><spring:message code="title.content"/></th>
				<th><spring:message code='font.color'/></th>
				<th><spring:message code='background.color'/></th>
				<th><spring:message code='font.size'/></th>
				<th><spring:message code='common.update_time'/></th>
				<th><spring:message code='common.creater'/></th>
				<th><spring:message code='audit.state'/></th>

				<th><spring:message code='common.operation'/></th>
				<th><spring:message code='common.remarks'/></th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="eleSourceTitle">
			<tr>
				<td>
					${eleSourceTitle.name}
				</td>
				<td>
					<a href="${ctx}/source/title/eleSourceTitle/form?id=${eleSourceTitle.id}">
						${eleSourceTitle.content}
					</a>
				</td>
				<td>
					<span title="${eleSourceTitle.fgcolor}"
						  style="display: block;width: 80px;height: 30px;
								  border: 1px solid;
								  background-color: ${fns:getColor(eleSourceTitle.fgcolor)};"></span>
				</td>
				<td>
					<span title="${eleSourceTitle.bgcolor}"
						  style="display: block;width: 80px;height: 30px;
								  border: 1px solid;
								  background-color: ${fns:getColor(eleSourceTitle.bgcolor)};"></span>
				</td>
				<td>
					${eleSourceTitle.size}
				</td>
					<td>
					<fmt:formatDate value="${eleSourceTitle.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					${eleSourceTitle.createBy.name}
					</td>
				<td>
					<c:if test="${eleSourceTitle.group != null}">
                    <c:if test="${eleSourceTitle.group.delFlag == '0'}">
                       <spring:message code="approved"/>
                    </c:if>
                    <c:if test="${eleSourceTitle.group.delFlag == '1'}">
                        <spring:message code='common.delete'/>
                    </c:if>
                    <c:if test="${eleSourceTitle.group.delFlag == '2'}">
                        <spring:message code='inapproval'/>
                    </c:if>
                    <c:if test="${eleSourceTitle.group.delFlag == '3'}">
                        <spring:message code="rejected"/>
                    </c:if>
                    </c:if>
                </td>

				<td>
					<shiro:hasPermission name="source:title:eleSourceTitle:edit">
						<a href="${ctx}/source/title/eleSourceTitle/form?id=${eleSourceTitle.id}"><spring:message
								code="common.modify"/></a>
						<a href="${ctx}/source/title/eleSourceTitle/applypublish?id=${eleSourceTitle.id}"><spring:message
								code="publish"/></a>

						<a href="${ctx}/source/title/eleSourceTitle/delete?id=${eleSourceTitle.id}"
						   onclick="return confirmx('<spring:message code='tips.deltitle'/>', this.href)"><spring:message code='common.delete'/></a>
					</shiro:hasPermission>
					<a href="javascript:void(0);" onclick="preview('title','${eleSourceTitle.id}')">
						<spring:message code="preview"/>
					</a>
				</td>
				<td>
						${eleSourceTitle.remarks}
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>